import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router';
import index from '../view/index.vue';
import signIn from '../view/signIn.vue';
import mainPage from '../view/mainPage.vue';
import dataShow from '@/components/contentPages/dataShow.vue';

export const routeMenu: Array<RouteRecordRaw> = [
    {
        path: '/NotImportant/DataShow',
        name: 'DataShow',
        component: dataShow
    },
]

// 根据routeMenu的name查找iconfont里的icon
export const menuIcon: { [prop: string]: string } = {
    DataShow: 'icon-shujugailan'
}

const routes: Array<RouteRecordRaw> = [
    {
        path: '/',
        name: 'Index',
        component: index,
    },
    {
        path: '/NotImportant',
        name: 'NotImportant',
        component: mainPage,
        children: [
            ...routeMenu
        ]
    },
    {
        path: '/SignIn',
        name: 'SignIn',
        component: signIn,
    },
];

export const router = createRouter({
    history: createWebHistory(),
    routes,
});
